package com.example.vueblog.common.utils;

import com.example.vueblog.entity.security.SelfUserDetails;
import org.springframework.security.core.context.SecurityContextHolder;

/**
 * @author yushunshun
 * @date 2022/5/29 15:06
 */
public class SecurityUtils {

    public static SelfUserDetails getUser(){
        return (SelfUserDetails)SecurityContextHolder.getContext().getAuthentication().getPrincipal();
    }
}
